/*DArSA1QqWXtgMQHvE01HYtP2AQrr9YFl51UCFxD23YXICaJNEuveSGCGGwBmCJIE*/
/*
 * @Descripttion:
 * @version:
 * @Author: Chendch
 * @Date: 2021-04-07 19:04:44
 * @LastEditors: Chendch
 * @LastEditTime: 2021-04-16 16:13:54
 */
import { formatDatetime } from 'nc-lightapp-front'

export const defineCustomerItem = (disKey = "") =>{
  return {
    renderStatus: 'customer',
    toggleEditStatusWhenEmitAfterEvent: true,
    render: (value, record, rowIndex, store, cellStatus) => {
        let obj =  !!disKey ? record.values[disKey] : value;
        console.log("666--", obj)
        if(record.values && record.values['refpath'] && record.values['refpath'].value == '@@@@Z0Z100000000XYHL'){
          // 阈值设置 是日历 这设置显示date
          obj.display = formatDatetime(obj.display||obj.value, 'date');
          obj.valye = formatDatetime(obj.display||obj.value, 'date');
        }
        if (cellStatus === 'browse' || cellStatus === 'editBrowse') {
            // 表格浏览态显示
            return <div>{obj.display||obj.value}</div>;
        }
        if (cellStatus === 'edit') {
            // 表格编辑态，单元格编辑态显示，如果return undefined 会走原来的逻辑
            return undefined;
        }
        return <i>{obj.display||obj.value}</i>;
    }
  }

}


/*DArSA1QqWXtgMQHvE01HYtP2AQrr9YFl51UCFxD23YXICaJNEuveSGCGGwBmCJIE*/
